<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .a {
        color: red;
      }
      .b {
        font-size: 40px;
      }
      .c {
        border: solid;
      }
      .d {
        background-color: antiquewhite;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <!-- 数据驱动视图（变量驱动DOM） -->
      <h2 v-bind:class="classObj">hello title</h2>
      <button @click="()=>activeA=!activeA">a</button>{{activeA}}
    </div>
    <script type="module">
      import { createApp, ref, reactive, computed } from "./vue.esm-browser.js";
      const app = createApp({
        setup() {
          const activeA = ref(true);
          const activeB = ref(true);
          const activeC = ref(true);
          const classObj = computed(() => {
            return {
              a: activeA.value,
              b: activeB.value,
              c: activeC.value,
            };
          });
          return {
            classObj,
            activeA,
            activeB,
            activeC,
          };
        },
      });
      app.mount("#app"); //挂载
    </script>
  </body>
</html>
